package org.erepublik.company.comparators;

import java.util.Comparator;

import org.erepublik.company.product.Product;

public class ProductComparatorByPriceInGold implements Comparator<Product> {

    @Override
    public int compare(Product o1, Product o2) {
        double comparator = o1.getPriceInGold() - o2.getPriceInGold();
        if (comparator < 0)
            return -1;
        if (comparator > 0)
            return 1;
        return 0;
    }

}
